import 'package:taonile/generated/json/base/json_convert_content.dart';
import 'package:taonile/entity/announcement_list_entity.dart';

AnnouncementListEntity $AnnouncementListEntityFromJson(Map<String, dynamic> json) {
	final AnnouncementListEntity announcementListEntity = AnnouncementListEntity();
	final int? code = jsonConvert.convert<int>(json['code']);
	if (code != null) {
		announcementListEntity.code = code;
	}
	final String? msg = jsonConvert.convert<String>(json['msg']);
	if (msg != null) {
		announcementListEntity.msg = msg;
	}
	final AnnouncementListData? data = jsonConvert.convert<AnnouncementListData>(json['data']);
	if (data != null) {
		announcementListEntity.data = data;
	}
	return announcementListEntity;
}

Map<String, dynamic> $AnnouncementListEntityToJson(AnnouncementListEntity entity) {
	final Map<String, dynamic> data = <String, dynamic>{};
	data['code'] = entity.code;
	data['msg'] = entity.msg;
	data['data'] = entity.data.toJson();
	return data;
}

AnnouncementListData $AnnouncementListDataFromJson(Map<String, dynamic> json) {
	final AnnouncementListData announcementListData = AnnouncementListData();
	final String? currentPage = jsonConvert.convert<String>(json['current_page']);
	if (currentPage != null) {
		announcementListData.currentPage = currentPage;
	}
	final List<AnnouncementListDataData>? data = jsonConvert.convertListNotNull<AnnouncementListDataData>(json['data']);
	if (data != null) {
		announcementListData.data = data;
	}
	return announcementListData;
}

Map<String, dynamic> $AnnouncementListDataToJson(AnnouncementListData entity) {
	final Map<String, dynamic> data = <String, dynamic>{};
	data['current_page'] = entity.currentPage;
	data['data'] =  entity.data.map((v) => v.toJson()).toList();
	return data;
}

AnnouncementListDataData $AnnouncementListDataDataFromJson(Map<String, dynamic> json) {
	final AnnouncementListDataData announcementListDataData = AnnouncementListDataData();
	final String? id = jsonConvert.convert<String>(json['id']);
	if (id != null) {
		announcementListDataData.id = id;
	}
	final String? title = jsonConvert.convert<String>(json['title']);
	if (title != null) {
		announcementListDataData.title = title;
	}
	final String? createdAt = jsonConvert.convert<String>(json['created_at']);
	if (createdAt != null) {
		announcementListDataData.createdAt = createdAt;
	}
	final String? updatedAt = jsonConvert.convert<String>(json['updated_at']);
	if (updatedAt != null) {
		announcementListDataData.updatedAt = updatedAt;
	}
	final String? content = jsonConvert.convert<String>(json['content']);
	if (content != null) {
		announcementListDataData.content = content;
	}
	return announcementListDataData;
}

Map<String, dynamic> $AnnouncementListDataDataToJson(AnnouncementListDataData entity) {
	final Map<String, dynamic> data = <String, dynamic>{};
	data['id'] = entity.id;
	data['title'] = entity.title;
	data['created_at'] = entity.createdAt;
	data['updated_at'] = entity.updatedAt;
	data['content'] = entity.content;
	return data;
}